from utils.sendmethod import Send_Method
from utils.operationdata import OperationData
from interface.mall_ums_member_controller import UmsMemberController
import pytest
ums=UmsMemberController()

class PaginateManage(Send_Method):
    mall_url = 'http://47.108.206.100:8085'

    def get_hot(self, pageNum=None, pageSize=None):
        """分页获取人气推荐商品"""
        url = self.mall_url.join('/home/hotProductList')
        payload = {'pageNum': pageNum, 'pageSize': pageSize}
        return self.send_Method(method='get', url=url, data=payload)

    def get_hot_log(self, pageNum=None, pageSize=None):
        url = self.mall_url.join('/home/hotProductList')
        payload = {'pageNum': pageNum, 'pageSize': pageSize}
        return self.send_Method(method='get', url=url, data=payload, headers=ums.sso_login())

    def get_sub(self, cateld=None, pageNum=None, pageSize=None):
        """根据分类获取专题"""
        url = self.mall_url.join('/home/subjectList')
        payload = {'cateld': cateld, 'pageNum': pageNum, 'pageSize': pageSize}
        return self.send_Method(method='get', url=url, data=payload)

if __name__ == '__main__':
    pytest.main(["-vs","home_page_hot_product_list.py"])